home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Snippets / GetFileIcon 1.1 / 1.0 ReadMe.c next >
Encoding:
Text File  |  1995-03-06  |  2.1 KB  |  51 lines  |  [TEXT/KAHL]

  1. /*
  2. GetFileIcon.c
  3. 1/2/95
  4. ver 1.0
  5.  
  6.  
  7.  
  8. GetFileIcon is based on the FindIcon.c code by James Walker.
  9.  
  10. Q: Why does GetFileIcon exist?  Why not use FindIcon?
  11. A: There are several reasons:
  12.     1.    Displaying a file's icon is one of the most intuitive things to do on a
  13.         a Macintosh.  Unfortunately, it is also very difficult; I would estimate
  14.         that there is at least one person a week on the comp.sys.mac.programmer
  15.         newsgroup who asks how to display the icon of a file.  Most programmers
  16.         are usually referred to the FindIcon code by James Walker, but the code only
  17.         shows how to get a files' icon; it doesn’t demonstrate how to display the
  18.         icon.  Several programmers have posted messages requesting further help...
  19.         this snippet is intended to take care of that need.
  20.  
  21.     2.    The FindIcon routines are able to get a file or a folders' icon.
  22.         Personally, I do not need to retrieve a folders' icon, so I took everything
  23.         that pertained to folders out (thus, reducing the amount of code by
  24.         approximately half).
  25.  
  26.     3.    The FindIcon routine is comprised of 13 source files and 14 header files.
  27.         With GetFileIcon, there are only two files to keep track of (GetFileIcon.c
  28.         and GetFileIcon.h).
  29.  
  30.     4.    When I compile my project, I always have strict type checking turned on.
  31.         Since GetFileIcon uses forbid_action() and forbid() in conjunction with
  32.         'gotos', it took quite a bit of tweaking on my part to get the code to work.
  33.  
  34.  
  35.  
  36. Q: How do I use GetFileIcon?
  37. A: Simple, In your THINK C project, make sure you have MacTraps and MacTraps2
  38.     added, then add GetFileIcon.c to the project.  For an example on how to call
  39.     GetFileIcon, look in GetFileIconExample.c.  BTW: This code seems to compile
  40.     fine under THINK C 6.0 -> 7.0.4... I do not know about earlier versions of
  41.     THINK C.
  42.  
  43.  
  44.  
  45. Other useful information:  If you wish to contact me, my Internet address is
  46. jbeeghly@u.washington.edu (at least it is until June '95).  I make no guarantees
  47. over the stability of the code (in other words, use it at your own risk).  If
  48. you want to find out more about getting & plotting a files' icon, I strongly suggest
  49. you get the code to FindIcon (available at most mac development FTP sites) and THINK
  50. Reference.
  51. */